populate next right pointer of each node